3D Graphics Programming with QuickDraw 3D 1.5.4
Previous | QD3D Book | Overview | Chapter Contents | Next |
This section describes the routines you can use to draw a viewer object and its contents.
You can use the Q3ViewerDraw function to draw a viewer object.
The Q3ViewerDraw function draws the viewer object specified by the theViewer parameter. You need to call this function only if the viewer flags or other visible features of a viewer have changed. For example, to change a viewer's pane, you need to call Q3ViewerSetBounds followed by Q3ViewerDraw . Similarly, if the viewer flags of a new viewer object have the kQ3ViewerActive flag clear, then to make the viewer object active you need to set that flag by calling Q3ViewerSetFlags and then draw the viewer object by calling Q3ViewerDraw .
You can use the Q3ViewerDrawContent function to draw the content region of a viewer object.
The Q3ViewerDrawContent function forces the 3D Viewer to rerender and redraw the 3D data displayed in the content region of the viewer object specified by the theViewer parameter. You should call Q3ViewerDrawContent only if you have directly modified the model associated with that viewer object using QuickDraw 3D functions. Q3ViewerDrawContent redraws only the content region of the viewer object and is preferable to calling Q3ViewerDraw , which also redraws the controller strip and other user interface elements.
You can use the Q3ViewerDrawControlStrip function to draw the controller strip and other user interface elements of a viewer object.
The Q3ViewerDrawControlStrip function forces the 3D Viewer to redraw the controller strip and other user interface elements of the viewer object specified by the theViewer parameter. (The user interface elements of a viewer object are its controller strip, its badge, and its drag border.) You might use Q3ViewerDrawControlStrip when you want to update the controller strip but do not want to rerender and redraw the model in the content region of the viewer object.
You can use the Q3ViewerSetDrawingCallbackMethod function to set a drawing completion callback routine for a viewer object. This function has no equivalent in the Windows environment.
OSErr Q3ViewerSetDrawingCallbackMethod (
TQ3ViewerObject theViewer,
TQ3ViewerDrawingCallbackMethod callbackMethod,
const void *data);
The Q3ViewerSetDrawingCallbackMethod function registers the function pointed to by the callbackMethod parameter as a drawing completion callback routine for the viewer object specified by the theViewer parameter. This callback routine is called each time the 3D Viewer completes a drawing operation requested by a call to Q3ViewerDraw , Q3ViewerDrawContent , or Q3ViewerDrawControlStrip .
You can use a callback routine to perform any operations that should follow a completed drawing operation. For instance, if a viewer is associated with an offscreen graphics world, you can use the drawing completion callback routine to copy the rendered image to its final destination.
Previous | QD3D Book | Overview | Chapter Contents | Next |